package org.juc.eightlock;
// 两个静态方法同步方法，两部手机，请问先打印邮件还是短信？

class Phone2 {
    public static synchronized  void sendEmail(){
        System.out.println("----------sendEmail");
    }
    public static synchronized void sendSMS(){
        System.out.println("----------sendSMS");
    }

}
public class PhoneExample4 {
    public static void main(String[] args) {
        // 静态方法也可以是实例调用？【虽然是对象调用，但是编译器还是改回来类调用】
        Phone2 phone2 = new Phone2();
        Phone2 phone1 = new Phone2();
        new Thread(()->{  phone2.sendEmail(); },"A").start();
        new Thread(()->{   phone1.sendSMS(); },"B").start();
    }
}
